#!/usr/bin/env python3
# -*-coding: utf-8-*-
# The function of find target string and return abs path

import os
import sys
sys.path.append('.')


# def find_target(path, target):
#     for i in os.listdir(path):
#         if os.path.isdir(i):
#             # print(i + '33')
#             # print(os.path.join(path, i))
#             print(find_target(os.path.join(path, i), target))
#         else:
#             # print(i)
#             if target in i:
#                 print(os.path.abspath(i))
#     pass

def find_str(p, targ):

    f_lst = [f for f in os.listdir(p) if os.path.isfile(f) and targ in f]
    d_lst = [f for f in os.listdir(p) if os.path.isdir(f)]

if __name__ == '__main__':

    path = '.'
    tar = 'ld.py'
    print(find_target(path, tar))



